<?php

$kriteria = getKriteria();

$o .= '<a href="?page=addkriteria"><i class="icon-user"></i> tambah kriteria</a><br>';
if ($kriteria) {
	
	$o .= '<table class="table table-striped table-bordered table-condensed">
			<tr>
				<td><center>No</td>
				<td><center>Nama Kriteria</td>
				<td><center>Bobot</td>
				<td><center>Username</td>
				<td colspan=2><center>Action</td>
			</tr>
	
		  ';
	
	$no = 1;
	
	foreach($kriteria as $x) {
		
		$o .= '<tr>
					<td><center>'.$no.'</td>
					<td><center>'.$x['nama_kriteria'].'</td>
					<td><center>'.$x['bobot_kriteria'].'</td>
					<td><center>'.$x['username'].'</td>
					<td><center><a href="?page=editkriteria&id='.$x['idkriteria'].'"><i class="icon-edit"></i>edit</a></td>
					<td><center><a href="#"><i class="icon-remove"></i>hapus</a></td>
			  </tr>';
			  
		$no++;
		
	}

	$o .= '</table>';

} else {

	$o .= '<div class="alert alert-error">
		  <center>Data kosong</center>
		  </div>';
} 

echo $o;
